<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // Math
        // console.log(Math.floor(Math.random()*5+1));

        //对象练习
        /* function createComputer(name, color, weight, type) {
            var obj = new Object();
            obj.name = name;
            obj.color = color;
            obj.weight = weight;
            obj.type = type;
            obj.play = function () {
                console.log('玩游戏');
            };
            obj.coding = function () {
                console.log('敲代码');
            };
            obj.music = function () {
                console.log('听音乐');
            };

            return obj;
        }
        var computer = createComputer('hp','black','5kg','暗影精灵2Pro');
        console.log(computer.name);
        console.log(computer.color);
        console.log(computer.weight);
        console.log(computer.type);
        computer.play();
        computer.coding();
        computer.music(); */

        /* function Buttons(name,width,height,bgcolor) {
            this.name = name;
            this.width = width;
            this.height = height;
            this.bgcolor = bgcolor;
            this.click = function () {
                console.log('点击了我');
            };
            this.hover = function () {
                console.log('鼠标进入');
            };
        }
        var btn = new Buttons('按钮','10px','10px','red');
        console.log(btn.name);
        console.log(btn.width);
        console.log(btn.height);
        console.log(btn.bgcolor);
        btn.click();
        btn.hover(); */

        /* var car = {
            weight: '1000kg',
            color: 'black',
            type: 'BMW',
            translate: function () {
                console.log('载人');
            }
        }
        console.log(car.weight);
        console.log(car.color);
        console.log(car.type);
        car.translate(); */

        /* console.log(Math.PI);
        console.log(Math.ceil(Math.PI));
        console.log(Math.floor(Math.PI));
        console.log(Math.floor(Math.random()*5+1)); */
        </script>
</body>
</html>